﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LiteStep.Currencies
{
	public abstract class BasicCurrency<T> : ICurrency<T>
		where T : ICurrency
	{
		public static ICurrencyType<T> Type = new CurrencyType<T>();

		public ICurrencyType<T> CurrencyType { get { return Type; } }

		public decimal Amount { get; private set; }

		public BasicCurrency(decimal amount)
		{
			if (amount < 0.0M)
				throw new ArgumentOutOfRangeException("amount", "amount must be >= 0.0M");

			this.Amount = amount;
		}

		public abstract T Create(decimal amount);
	}
}
